package gui.visu.listeners;

import gui.visu.dialogs.JDialogAddDisplayDataAtPosition;

import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.BorderFactory;

import tuio.components.LabelTouch;

public class ListenerLabelTouchInScrollPane implements MouseListener{

	private JDialogAddDisplayDataAtPosition parent;

	private LabelTouch label;
	

	public ListenerLabelTouchInScrollPane(JDialogAddDisplayDataAtPosition parent, LabelTouch label) {
		this.parent = parent;
		this.label = label;
	}


	@Override
	public void mouseClicked(MouseEvent arg0) {
		if(parent.getSelectedLabel()!=null){
			parent.getSelectedLabel().setBorder(BorderFactory.createLineBorder(Color.BLACK));
			parent.getSelectedLabel().setForeground(Color.BLACK);
		}
		parent.setSelectedLabel(label);
		label.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.BLACK));
		label.setForeground(Color.RED);
	}

	@Override
	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mousePressed(MouseEvent arg0) {
	}

	@Override
	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

}
